package it.polimi.swKnights.SWIMv2.ejb.entityBeans;

import java.io.Serializable;

public class FriendshipPk implements Serializable
{
	private String userName1;
	
	private String userName2;
	
	/*
	 * Serial Version ID
	 */
	
	private static final long serialVersionUID = -2803477195476494392L;
	
	/*
	 * equals and hashCode
	 */

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((userName1 == null) ? 0 : userName1.hashCode());
		result = prime * result
				+ ((userName2 == null) ? 0 : userName2.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FriendshipPk other = (FriendshipPk) obj;
		if (userName1 == null)
		{
			if (other.userName1 != null)
				return false;
		} else if (!userName1.equals(other.userName1))
			return false;
		if (userName2 == null)
		{
			if (other.userName2 != null)
				return false;
		} else if (!userName2.equals(other.userName2))
			return false;
		return true;
	}

	/*
	 * Getters and setters
	 */
	
	public String getUserName1()
	{
		return userName1;
	}

	public void setUserName1(String userName1)
	{
		this.userName1 = userName1;
	}

	public String getUserName2()
	{
		return userName2;
	}

	public void setUserName2(String userName2)
	{
		this.userName2 = userName2;
	}
	
}
